<?php
class competeAction extends backendAction
{
    public function _initialize() {
        parent::_initialize();
        $this->_mod = D('admin');
        $this->_cate_mod = D('region');
    }

    public function _before_index() {
        
        $this->list_relation = true;
    }

    protected function _search() {
        $map = array();

        if($keyWord = $this->_request('keyWord', 'trim')){ 
            $where['agents']  = array('like','%'.$keyWord.'%');
            $where['agentsPolicy']  = array('like','%'.$keyWord.'%');
            $where['storePolicy']  = array('like','%'.$keyWord.'%');
            $where['cmccPolicy']  = array('like','%'.$keyWord.'%');
            $where['_logic'] = 'or';
            $map['_complex'] = $where;
        }
        ($time_start = $this->_request('time_start', 'trim')) && $map['createTime'][] = array('egt', strtotime($time_start));
        ($time_end = $this->_request('time_end', 'trim')) && $map['createTime'][] = array('elt', strtotime($time_end)+(24*60*60-1));

        $this->assign('search', array(
            'time_start' => $time_start,
            'time_end' => $time_end,
            'keyWord' => $keyWord,
        ));
        return $map;
    }
    
    

        
}